package com.telit.android.dao;

import com.telit.android.entity.AppHomePageApplication;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface AppHomePageApplicationDao {
    int deleteByPrimaryKey(Long id);

    int insert(AppHomePageApplication record);

    int insertSelective(AppHomePageApplication record);

    AppHomePageApplication selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(AppHomePageApplication record);

    int updateByPrimaryKey(AppHomePageApplication record);

    /**
     * 根据userId查询应用
     * @param userId
     * @return
     */
    List<AppHomePageApplication> queryByUserId(@Param("userId") Long userId);

    /**
     * 查询默认应用首页
     * @return
     */
    List<AppHomePageApplication> queryDefaultPage(@Param("userRole") String userRole);

    /**
     * 根据userId删除数据
     * @param userId
     */
    void deleteByUserId(@Param("userId")Long userId);

    /**
     * 查询图片地址
     * @param applicationName
     * @return
     */
    String queryImageUrl(@Param("applicationName")String applicationName);

}